<!doctype html>
<html class="no-js" lang="fr">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>我的邀请</title>
    <meta name="description" content="Xolio - Creative Agency Template">
    <meta name="viewport" content="width=device-width, initial-scale=1">


    <!-- Place favicon.ico in the root directory -->




    <style>
        .cont_box{
            width: 100%;
            border-radius: 8px;
            background-color:#f8fafb;
            padding:10px 15px;
        }

        .title{
            font-size: 24px;
            line-height: 50rpx;
            margin:20px 0;
            color: #000;
        }


        .card-body a{
            width: 100%;
            display: block;
            margin-bottom: 10px;
        }
        .card-body .btn{
            width: 150px;
            background-color:#00989b ;
            padding:10px 0;
            text-align: center;
            border-radius: 8px;
            float: right;

        }
        .card-body .code{
            width: 130px;
            height: 131px;
            margin-top: -10px;
            margin-left: 50px;
        }
    </style>
</head>
<body>



<include file="public@nav"/>


<!-- main-area -->
<main>

    <!-- blog-details-area -->
    <section class="blog-details-area pt-120 pb-40">
        <div class="container">
            <div class="row justify-content-center">
                <div class="row">
                    <div class="col">
                        <div class="card">
                            <div class="card-body">
                                <h5 class="card-title">我的邀请链接</h5>
                                <a href="#" class="card-text">{$domain}</a>
                                <input type="hidden" id="domain" value="{$domain}">
                                <button  class="btn btn-primary" onclick="copyText()">复制链接</button>
                            </div>
                        </div>
                    </div>
                    <div class="col">
                        <div class="card">
                            <div class="card-body" style="display: flex;padding-bottom:0;">
                                <h5 class="card-title">我的邀请码</h5>
                                <img class="code" src="{:cmf_get_image_url($imageUrl)}" width="100px" height="100px">

                            </div>
                        </div>
                    </div>
                </div>

                <br/>
                <br/>
                <br/>
                <br/>
                <br/>
                &nbsp;
                <br/>
                <br/>
                <br/>
                <br/>

                <div class="title">已邀请列表</div>
                <div class="cont_box">
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th scope="col">序号</th>
                            <th scope="col">电话</th>
                            <th scope="col">开户状态</th>
                            <th scope="col">时间</th>
                        </tr>
                        </thead>
                        <tbody>
                        <foreach name="userList" item="vo">
                            <tr>
                                <th scope="row">{$vo.id}</th>
                                <td>{$vo.mobile}</td>
                                <td> <if condition="$vo.open_status eq 1" > 已开户 <else/> 未开户 </if> </td>
                                <td>{:date('Y-m-d',$vo.published_time)}</td>
                            </tr>
                        </foreach>


                        </tbody>
                    </table>
                    <if condition="count($userList) lt 1" >

                        暂无数据


                    </if>
                </div>


            </div>
        </div>
    </section>
    <!-- blog-details-area-end -->



</main>
<!-- main-area-end -->

<!-- 提示 -->
<div class="toast-container position-fixed bottom-10 end-0 p-3">
    <div id="liveToast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
        <div class="toast-header">
            <img src="__TMPL__/public/static/picture/w_logo.png" class="rounded me-2" alt="..." style="width: 50px;height:20px;">
            <strong class="me-auto">复制成功</strong>
            <button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
        </div>
        <div class="toast-body">
            链接地址：{$domain}
        </div>
    </div>
</div>

<!-- 页尾 -->
<footer>
    <div class="footer-area" style="display: none">
        <div class="footer-top">
            <div class="container">
                <div class="row">
                    <div class="col-lg-3 col-sm-6">
                        <div class="footer-widget">
                            <div class="logo">
                                <a href=""
                                ><img src="__TMPL__/public/static/picture/w_logo.png" alt=""
                                /></a>
                            </div>
                            <div class="footer-contact">
                                <span>九鼎返佣网</span>
                                <span>你外汇交易的贴身管家</span>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-4 col-sm-8">
                        <div class="footer-widget">
                            <div class="fw-link">
                                <ul class="list-wrap">
                                    <li><a href="">联系电话</a>  <span>0531-1234567</span></li>
                                    <li><a href="">邮   件</a>  <span>asdfghhjl</span></li>
                                    <li><a href="">工作时间</a>  <span>周一至周日9:00-22:00</span></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-2 col-sm-4">
                        <div class="footer-widget">
                            <div class="fw-link">
                                <ul class="list-wrap">
                                    <li><a href="">链接</a></li>
                                    <li><a href="">推荐平台</a></li>
                                    <li><a href="">关于我们</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-sm-6">
                        <div class="footer-widget">
                            <div class="footer-about">
                                <ul class="list_img">
                                    <li>
                                        <img src="__TMPL__/public/static/image/code.png" alt="" /><a
                                            href="mailto:company@gmail.com"
                                    >扫码加QQ群</a
                                    >
                                    </li>
                                    <li>
                                        <img src="__TMPL__/public/static/image/code.png" alt="" /><a
                                            href="mailto:company@gmail.com"
                                    >扫码加QQ群</a
                                    >
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="footer-bottom">
            <div class="container">
                <div class="row align-items-center">
                    <div class="col-md-12">
                        <div class="copyright-text text-end">
                            <p>        {$site_info.site_static|default=''}</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</footer>
<!-- 页尾 -->

<!-- JS here -->
<script src="__TMPL__/public/static/js/jquery-3.6.0.min.js"></script>
<script src="__TMPL__/public/static/js/bootstrap.min.js"></script>
<script src="__TMPL__/public/static/js/isotope.pkgd.min.js"></script>
<script src="__TMPL__/public/static/js/imagesloaded.pkgd.min.js"></script>
<script src="__TMPL__/public/static/js/jquery.magnific-popup.min.js"></script>
<script src="__TMPL__/public/static/js/jquery.odometer.min.js"></script>
<script src="__TMPL__/public/static/js/swiper-bundle.min.js"></script>
<script src="__TMPL__/public/static/js/jquery.appear.js"></script>
<script src="__TMPL__/public/static/js/slick.min.js"></script>
<script src="__TMPL__/public/static/js/ajax-form.js"></script>
<script src="__TMPL__/public/static/js/parallax.min.js"></script>
<script src="__TMPL__/public/static/js/jquery.parallaxScroll.min.js"></script>
<script src="__TMPL__/public/static/js/tween-max.js"></script>
<script src="__TMPL__/public/static/js/wow.min.js"></script>
<script src="__TMPL__/public/static/js/main.js"></script>

<script>

    let domain = $("#domain").val()
    const toastTrigger = document.getElementById('liveToastBtn')
    const toastLiveExample = document.getElementById('liveToast')

    const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastLiveExample)

    function copyToClipboard(text) {
        // 创建一个textarea元素
        const textarea = document.createElement('textarea');

        // 设置文本内容
        textarea.value = text;

        // 隐藏元素
        textarea.style.position = 'fixed';
        textarea.style.opacity = '0';

        // 将元素添加到DOM中
        document.body.appendChild(textarea);

        // 选中文本
        textarea.select();

        // 复制到剪贴板
        try {
            const successful = document.execCommand('copy');
            console.log(successful ? 'Copy successful' : 'Copy failed');
        } catch (err) {
            console.error('Failed to copy text', err);
        }

        // 移除添加的textarea元素
        document.body.removeChild(textarea);
    }

    function copyText() {
        this.copyToClipboard(domain)
        toastBootstrap.show()
    }


</script>
</body>
</html>
